# 文件说明：定义主程序入口

from calculator.controller import CalculatorController

def main():
    controller = CalculatorController()
    print("Welcome to the command-line calculator. Type 'exit' to quit.")
    
    while True:
        input_str = input("Enter expression: ")
        result = controller.process_input(input_str)
        if result == 'exit':
            break
        elif result == 'history':
            history = controller.model.get_history()
            display_history(history)
        else:
            display_result(result)

if __name__ == "__main__":
    main()